new VehiclesInMenu[16]=
{
	541,
	506,
	411,
	451,
	496,
	557,
	495,
	568,
	573,
	471,
	468,
	522,
	539,
	571,
	457,
	510,
};
enum WheelEnum{mod,w_name[10]}
new Wheels[17][WheelEnum]=
{
	{1073, "Shadow"},
	{1074, "Mega"},
	{1075, "Rimshine"},
	{1076, "Wires"},
	{1077, "Classic"},
	{1078, "Twist"},
	{1079, "Cutter"},
	{1080, "Switch"},
	{1081, "Grove"},
	{1082, "Import"},
	{1083, "Dollar"},
	{1084, "Trance"},
	{1085, "Atomic"},
	{1096, "Ahab"},
	{1097, "Virtual"},
	{1098, "Access"},
	{1025, "Offroad"}
};
enum ColourEnum{colour1,colour2,c_name[10]}
new vColours[8][ColourEnum]=
{
	{0, 0, "Black"},
	{1, 1, "White"},
	{7, 7, "Blue"},
	{3, 3, "Red"},
	{6, 6, "Yellow"},
	{86, 86, "Green"},
	{126, 126, "Pink"},
	{148, 148, "Purple"}
};
enum WeatherEnum{weather_id,w_name[10]}
new Weathers[9][WeatherEnum]=
{
	{0, "Sunny"},
	{8, "Stormy"},
	{9, "Foggy"},
	{11, "Hot"},
	{12, "Dull"},
	{16, "Rainy"},
	{19, "Sandstorm"},
	{20, "Green"},
	{43, "Toxic"}
};

CMD:v(playerid, params[])
{
	if(bPlayerGameSettings[playerid]&InDM || bServerGlobalSettings&FreeDM)return 0;
	else ShowCarMenu(playerid);
	return 1;
}
CMD:mod(playerid, params[])
{
	if(bPlayerGameSettings[playerid]&InDM || bServerGlobalSettings&FreeDM)return 0;
	else ShowModMenu(playerid);
	return 1;
}
CMD:items(playerid, params[])
{
	if(bPlayerGameSettings[playerid]&InDM || bServerGlobalSettings&FreeDM)return 0;
	else ShowItemMenu(playerid);
	return 1;
}
CMD:weather(playerid, params[])
{
	if(bPlayerGameSettings[playerid]&InDM || bServerGlobalSettings&FreeDM)return 0;
	else ShowWeatherMenu(playerid);
	return 1;
}


ShowCarMenu(playerid)
{
	new str[256];
	for(new x;x<(sizeof(VehiclesInMenu));x++)format(str, 256, "%s\n%s", str, VehicleNames[VehiclesInMenu[x]-400]);
	if(IsPlayerAdmin(playerid))strins(str, "\nEnter ID", strlen(str));
	ShowPlayerDialog(playerid, d_eVehicle, DIALOG_STYLE_LIST, "Choose a car to spawn", str, "spawn", "cancel");
}
ShowModMenu(playerid)
{
	ShowPlayerDialog(playerid, d_eVehicleMod, DIALOG_STYLE_LIST, "Choose some mods for your car", "Nitro\nHydraulics\nWheels\nColours\nPaintjobs", "Select", "Cancel");
}
ShowWheelMenu(playerid)
{
	new str[170];
	for(new x;x<sizeof(Wheels);x++)format(str, 170, "%s\n%s", str, Wheels[x][WheelEnum:1]);
	ShowPlayerDialog(playerid, d_eWheels, DIALOG_STYLE_LIST, "Choose some wheels to add to your vehicle", str, "Select", "Cancel");
}
ShowColourMenu(playerid)
{
	new str[128];
	for(new x;x<sizeof(vColours);x++)format(str, 128, "%s\n%s", str, vColours[x][ColourEnum:1]);
	ShowPlayerDialog(playerid, d_eColours, DIALOG_STYLE_LIST, FormatColours("Choose vehicle {FFFF00}colours"), str, "Set", "Cancel");
}
ShowPaintjobMenu(playerid)
{
	ShowPlayerDialog(playerid, d_ePaintjob, DIALOG_STYLE_LIST, FormatColours("Choose a vehicle {FFFF00}Paintjob"), "Paintjob 1\nPaintjob 2\nPaintjob 3", "Set", "Cancel");
}
ShowItemMenu(playerid)
{
	ShowPlayerDialog(playerid, d_eItemList, DIALOG_STYLE_LIST, "Item menu", "Parachute\nCamera\nJetpack", "Set", "Cancel");
}
ShowWeatherMenu(playerid)
{
	new str[128];
	for(new x;x<sizeof(Weathers);x++)format(str, 128, "%s\n%s", str, Weathers[x][WeatherEnum:1]);
	ShowPlayerDialog(playerid, d_eWeather, DIALOG_STYLE_LIST, "Choose a weather type", str, "Set", "Cancel");
}

script_Extras_DialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == d_eVehicle && response)
	{
	    if(listitem==sizeof(VehiclesInMenu))ShowPlayerDialog(playerid, d_eEnterModel, DIALOG_STYLE_INPUT, "Vehicle Spawn", "Enter a model id between 400 and 612", "Spawn", "Close");
		else SpawnCarForPlayer(playerid, VehiclesInMenu[listitem], 0);
	}
	if(dialogid == d_eVehicleMod && response)
	{
		switch(listitem)
		{
			case 0:{AddVehicleComponent(GetPlayerVehicleID(playerid), 1010),ShowModMenu(playerid),PlayerPlaySound(playerid, 1133, 0, 0, 0);}
			case 1:{AddVehicleComponent(GetPlayerVehicleID(playerid), 1087),ShowModMenu(playerid),PlayerPlaySound(playerid, 1133, 0, 0, 0);}
			case 2:ShowWheelMenu(playerid);
			case 3:ShowColourMenu(playerid);
			case 4:ShowPaintjobMenu(playerid);
		}
	}
	if(dialogid == d_eWheels && response){AddVehicleComponent(GetPlayerVehicleID(playerid), Wheels[listitem][mod]),PlayerPlaySound(playerid, 1133, 0, 0, 0);}
	if(dialogid == d_eColours && response)ChangeVehicleColor(GetPlayerVehicleID(playerid), vColours[listitem][colour1], vColours[listitem][colour2]);
	if(dialogid == d_ePaintjob && response)ChangeVehiclePaintjob(GetPlayerVehicleID(playerid), listitem);
	if(dialogid == d_eItemList && response)
	{
		switch(listitem)
		{
			case 0:GivePlayerWeapon(playerid, 46, 1);
			case 1:GivePlayerWeapon(playerid, 43, 1);
			case 2:SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
		}
	}
	if(dialogid == d_eWeather && response)SetPlayerWeather(playerid, Weathers[listitem][WeatherEnum:0]);
	if(dialogid == d_eEnterModel && response)
	{
	    new id=strval(inputtext);
	    if(id<400||id>612)
	    {
	        msg(playerid, RED, "Invalid ID, please use numbers between 400 and 612");
			ShowPlayerDialog(playerid, d_eEnterModel, DIALOG_STYLE_INPUT, "Vehicle Spawn", "Enter a model id between 400 and 612", "Spawn", "Close");
	    }
	    else SpawnCarForPlayer(playerid, id);
	}
	return 1;
}

